//创建Koa中间件
const koa = require('koa')
const app = new koa()

//绑定中间件
//绑定第一层中间件
const respDurationMiddleware = require('./middleware/koa_response_duration')
app.use(respDurationMiddleware)

//绑定第二层中间件
const respHeaderMiddleware = require('./middleware/koa_response_header')
app.use(respHeaderMiddleware)

//绑定第三层中间件
const respDataMiddlware = require('./middleware/koa_response_data')
app.use(respDataMiddlware)

//绑定端口号
app.listen(8888)

const webSocketServer = require('./server/web_socket_server')
//开启服务的的监听
webSocketServer.listen()